package com.aspose.cells;

import java.util.HashMap;
import java.util.Locale;

public class WorkbookSettings {
   private Workbook q;
   LoadOptions a;
   private zxx r;
   short b = 1200;
   boolean c;
   private boolean s;
   private zast t;
   zcx d;
   private boolean u;
   private boolean v;
   private boolean w = false;
   byte e = 2;
   private boolean x = false;
   private int y = 0;
   private boolean z;
   private int A = 100;
   private double B = 0.001D;
   private int C = 0;
   int f = 145621;
   private int D = 200;
   boolean g = false;
   private boolean E = false;
   private boolean F = true;
   private boolean G = true;
   private short H = 600;
   private boolean I = true;
   private boolean J = true;
   private int K = 0;
   Encoding h = Encoding.getDefault();
   boolean i = true;
   private String L;
   boolean j;
   int k;
   private boolean M;
   private boolean N = true;
   private HashMap O;
   private boolean P;
   private boolean Q;
   private boolean R = true;
   boolean l = true;
   private short S;
   boolean m = false;
   private boolean T = true;
   private SmartTagOptions U;
   private String V = "Arial";
   private int W = 200;
   private int X = 9225;
   private int Y = 14940;
   private int Z = 120;
   private int aa = 240;
   private boolean ab = false;
   boolean n = false;
   boolean o = false;
   private boolean ac = true;
   private boolean ad = true;
   byte p;
   private zpl ae;
   private int af;

   void a() {
      if (this.d == null) {
         this.d = new zcx();
      }

   }

   zcx b() {
      if (this.d == null) {
         this.d = new zcx();
      }

      return this.d;
   }

   zast c() {
      return this.t;
   }

   public boolean getEnableMacros() {
      return this.u;
   }

   public void setEnableMacros(boolean value) {
      this.u = value;
   }

   WorkbookSettings(Workbook workbook, int region) {
      this.af = zml.p;
      this.q = workbook;
      this.t = new zast();
      this.r = new zxx(region);
      this.r.a((zaha)(new zakd(this.t)));
      this.r.a(this.v);
      this.j = false;
      this.k = 0;
      this.L = null;
      new com.aspose.cells.a.d.zfs(false);
   }

   public boolean getDate1904() {
      return this.v;
   }

   public void setDate1904(boolean value) {
      this.v = value;
      this.r.a(value);
   }

   public int getProtectionType() {
      return this.q.getWorksheets().O();
   }

   public boolean getPrecisionAsDisplayed() {
      return this.w;
   }

   public void setPrecisionAsDisplayed(boolean value) {
      this.w = value;
   }

   public boolean getReCalculateOnOpen() {
      return (this.e & 255 & 2) != 0;
   }

   public void setReCalculateOnOpen(boolean value) {
      if (value) {
         this.e = (byte)(this.e | 2);
      } else {
         this.e = (byte)(this.e & 253);
      }

   }

   public boolean getCreateCalcChain() {
      return this.x;
   }

   public void setCreateCalcChain(boolean value) {
      this.x = value;
   }

   public int getDisplayDrawingObjects() {
      return this.y;
   }

   public void setDisplayDrawingObjects(int value) {
      this.y = value;
   }

   public boolean getIteration() {
      return this.z;
   }

   public void setIteration(boolean value) {
      this.z = value;
   }

   public int getMaxIteration() {
      return this.A;
   }

   public void setMaxIteration(int value) {
      this.A = value;
   }

   public double getMaxChange() {
      return this.B;
   }

   public void setMaxChange(double value) {
      this.B = value;
   }

   public int getCalcMode() {
      return this.C;
   }

   public void setCalcMode(int value) {
      this.C = value;
   }

   public String getCalculationId() {
      return zase.y(this.f);
   }

   public void setCalculationId(String value) {
      this.f = zase.C(value);
   }

   public int getCalcStackSize() {
      return this.D;
   }

   public void setCalcStackSize(int value) {
      this.D = value;
      this.g = true;
   }

   boolean d() {
      return this.E;
   }

   void a(boolean var1) {
      this.E = var1;
   }

   public boolean getRecalculateBeforeSave() {
      return this.F;
   }

   public void setRecalculateBeforeSave(boolean value) {
      this.F = value;
   }

   public int getSheetTabBarWidth() {
      return this.H;
   }

   public void setSheetTabBarWidth(int value) {
      this.H = (short)value;
   }

   public boolean getShowTabs() {
      return this.G;
   }

   public void setShowTabs(boolean value) {
      this.G = value;
   }

   public int getFirstVisibleTab() {
      return this.q.getWorksheets().C();
   }

   public void setFirstVisibleTab(int value) {
      this.q.getWorksheets().l(value);
   }

   public boolean isHScrollBarVisible() {
      return this.I;
   }

   public void setHScrollBarVisible(boolean value) {
      this.I = value;
   }

   public boolean isVScrollBarVisible() {
      return this.J;
   }

   public void setVScrollBarVisible(boolean value) {
      this.J = value;
   }

   public boolean getShared() {
      return this.s;
   }

   public void setShared(boolean value) {
      this.s = value;
   }

   public int getLanguageCode() {
      return this.K;
   }

   public void setLanguageCode(int value) {
      this.K = value;
   }

   zxx e() {
      return this.r;
   }

   public int getRegion() {
      return this.r.b();
   }

   public void setRegion(int value) {
      this.r.a(value);
   }

   public Locale getLocale() {
      return com.aspose.cells.a.c.zj.a(this.r.a());
   }

   public void setLocale(Locale value) {
      this.a(com.aspose.cells.a.c.zj.b(value));
   }

   void a(com.aspose.cells.b.a.c.za var1) {
      this.r.a(var1);
   }

   public char getNumberDecimalSeparator() {
      return this.r.f().d();
   }

   public void setNumberDecimalSeparator(char value) {
      if (value != this.r.f().d()) {
         this.r.a(value, this.r.f().e());
      }

   }

   public char getNumberGroupSeparator() {
      return this.r.f().e();
   }

   public void setNumberGroupSeparator(char value) {
      if (value != this.r.f().e()) {
         this.r.a(this.r.f().d(), value);
      }

   }

   Encoding f() {
      return this.h;
   }

   void a(Encoding var1) {
      this.h = var1;
      this.i = false;
   }

   public String getPassword() {
      return this.L;
   }

   public void setPassword(String value) {
      this.L = value;
   }

   public boolean getRecommendReadOnly() {
      return this.M;
   }

   public void setRecommendReadOnly(boolean value) {
      this.M = value;
      if (value) {
         this.setWriteProtected(true);
      }

   }

   public boolean isWriteProtected() {
      return this.j;
   }

   public void setWriteProtected(boolean value) {
      this.j = value;
   }

   public void setWriteProtectedPassword(String value) {
      if (value != null && !"".equals(value)) {
         this.k = zsw.a(value);
         this.j = true;
      } else {
         this.k = 0;
         this.j = false;
      }

   }

   int g() {
      return this.k;
   }

   void a(int var1) {
      this.k = var1;
      this.setWriteProtected(true);
   }

   public boolean isProtected() {
      return this.q.getWorksheets().P();
   }

   public boolean isDefaultEncrypted() {
      return this.N;
   }

   public void setDefaultEncrypted(boolean value) {
      this.N = value;
   }

   HashMap h() {
      if (this.O == null) {
         this.O = new HashMap();
         this.O.put("CG Times (W1)", "Times New Roman");
         this.O.put("CG Times", "Times New Roman");
      }

      return this.O;
   }

   public boolean isMinimized() {
      return this.P;
   }

   public void setMinimized(boolean value) {
      this.P = value;
   }

   public boolean isHidden() {
      return this.Q;
   }

   public void setHidden(boolean value) {
      this.Q = value;
   }

   boolean i() {
      return this.R;
   }

   void b(boolean var1) {
      this.R = var1;
   }

   public boolean getAutoCompressPictures() {
      return this.l;
   }

   public void setAutoCompressPictures(boolean value) {
      this.l = value;
   }

   public boolean getRemovePersonalInformation() {
      return this.d == null ? false : this.d.c();
   }

   public void setRemovePersonalInformation(boolean value) {
      this.b().b(value);
   }

   public boolean getHidePivotFieldList() {
      return this.d == null ? false : this.d.b();
   }

   public void setHidePivotFieldList(boolean value) {
      this.b().a(value);
   }

   short j() {
      return this.S;
   }

   void a(short var1) {
      this.S = var1;
   }

   public int getUpdateLinksType() {
      byte var1 = 0;
      switch(this.S & 96) {
      case 32:
         var1 = 1;
         break;
      case 64:
         var1 = 2;
      }

      return var1;
   }

   public void setUpdateLinksType(int value) {
      this.S = (short)(this.S & -97);
      switch(value) {
      case 1:
         this.S = (short)(this.S | 32);
         break;
      case 2:
         this.S = (short)(this.S | 64);
      }

   }

   void a(WorkbookSettings var1) {
      if (var1.d != null) {
         this.b().a(var1.d);
      }

      this.p = var1.p;
      this.S = var1.S;
      this.R = var1.R;
      this.H = var1.H;
      this.aa = var1.aa;
      this.Z = var1.Z;
      this.Y = var1.Y;
      this.X = var1.X;
      this.Q = var1.Q;
      this.P = var1.P;
      this.I = var1.I;
      this.J = var1.J;
      this.s = var1.s;
      this.t.a(var1.t);
      this.b = var1.b;
      this.T = var1.T;
      this.j = var1.j;
      this.k = var1.k;
      this.setRecommendReadOnly(var1.getRecommendReadOnly());
      this.L = var1.L;
      this.v = var1.v;
      this.w = var1.w;
      this.y = var1.y;
      this.e = var1.e;
      this.z = var1.z;
      this.B = var1.B;
      this.A = var1.A;
      this.C = var1.C;
      this.r.a(var1.r);
      this.K = var1.K;
      this.h = var1.h;
      this.i = var1.i;
      if (var1.U != null) {
         this.U = new SmartTagOptions();
         this.U.a(var1.U);
      }

   }

   int k() {
      return this.q.i() == 0 ? '\uffff' : 1048575;
   }

   int l() {
      return this.q.i() == 0 ? 255 : 16383;
   }

   public boolean getParsingFormulaOnOpen() {
      return this.T;
   }

   public void setParsingFormulaOnOpen(boolean value) {
      this.T = value;
   }

   SmartTagOptions m() {
      if (this.U == null) {
         this.U = new SmartTagOptions();
      }

      return this.U;
   }

   SmartTagOptions n() {
      return this.U;
   }

   String o() {
      return this.V;
   }

   void a(String var1) {
      this.V = var1;
   }

   int p() {
      return this.W;
   }

   void a(double var1) {
      this.W = (int)(var1 * 20.0D + 0.5D);
   }

   int q() {
      return this.aa;
   }

   void b(int var1) {
      this.aa = var1;
   }

   public double getWindowLeft() {
      return (double)this.q() / 20.0D;
   }

   public void setWindowLeft(double value) {
      this.b((int)(value * 20.0D + 0.5D));
   }

   public double getWindowLeftInch() {
      return (double)((float)this.q() / 1440.0F);
   }

   public void setWindowLeftInch(double value) {
      this.b((int)(value * 20.0D * 72.0D + 0.5D));
   }

   public double getWindowLeftCM() {
      return this.getWindowLeftInch() * 2.54D;
   }

   public void setWindowLeftCM(double value) {
      this.setWindowLeftInch(value / 2.54D);
   }

   int r() {
      return this.Z;
   }

   void c(int var1) {
      this.Z = var1;
   }

   public double getWindowTop() {
      return (double)this.r() / 20.0D;
   }

   public void setWindowTop(double value) {
      this.c((int)(value * 20.0D + 0.5D));
   }

   public double getWindowTopInch() {
      return (double)((float)this.r() / 1440.0F);
   }

   public void setWindowTopInch(double value) {
      this.c((int)(value * 20.0D * 72.0D + 0.5D));
   }

   public double getWindowTopCM() {
      return this.getWindowTopInch() * 2.54D;
   }

   public void setWindowTopCM(double value) {
      this.setWindowTopInch(value / 2.54D);
   }

   int s() {
      return this.Y;
   }

   void d(int var1) {
      this.Y = var1;
   }

   public double getWindowWidth() {
      return (double)this.s() / 20.0D;
   }

   public void setWindowWidth(double value) {
      this.d((int)(value * 20.0D + 0.5D));
   }

   public double getWindowWidthInch() {
      return (double)((float)this.s() / 1440.0F);
   }

   public void setWindowWidthInch(double value) {
      this.d((int)(value * 20.0D * 72.0D + 0.5D));
   }

   public double getWindowWidthCM() {
      return this.getWindowWidthInch() * 2.54D;
   }

   public void setWindowWidthCM(double value) {
      this.setWindowWidthInch(value / 2.54D);
   }

   int t() {
      return this.X;
   }

   void e(int var1) {
      this.X = var1;
   }

   public double getWindowHeight() {
      return (double)this.t() / 20.0D;
   }

   public void setWindowHeight(double value) {
      this.e((int)(value * 20.0D + 0.5D));
   }

   public double getWindowHeightInch() {
      return (double)((float)this.t() / 1440.0F);
   }

   public void setWindowHeightInch(double value) {
      this.e((int)(value * 20.0D * 72.0D + 0.5D));
   }

   public double getWindowHeightCM() {
      return this.getWindowHeightInch() * 2.54D;
   }

   public void setWindowHeightCM(double value) {
      this.setWindowHeightInch(value / 2.54D);
   }

   public boolean getUpdateAdjacentCellsBorder() {
      return this.ab;
   }

   public void setUpdateAdjacentCellsBorder(boolean value) {
      this.ab = value;
   }

   void a(int var1, int var2, boolean var3) {
      this.G = true;
      this.H = 600;
      this.Q = false;
      this.P = false;
      this.I = true;
      this.J = true;
      this.s = false;
      this.X = 9225;
      this.Y = 14940;
      this.Z = 120;
      this.aa = 240;
      this.t = new zast();
      this.m = false;
      this.j = false;
      this.k = 0;
      this.setRecommendReadOnly(false);
      this.v = false;
      this.w = false;
      this.y = 0;
      this.e = 2;
      this.z = false;
      this.B = 0.001D;
      this.A = 100;
      this.C = 0;
      this.U = null;
      switch(var1) {
      case 5:
         this.e().a((com.aspose.cells.b.a.c.za)null);
         this.setLanguageCode(0);
      default:
      }
   }

   public boolean getCheckComptiliblity() {
      return this.ac;
   }

   public void setCheckComptiliblity(boolean value) {
      this.ac = value;
   }

   public boolean getCheckExcelRestriction() {
      return this.ad;
   }

   public void setCheckExcelRestriction(boolean value) {
      this.ad = value;
   }

   public boolean getAutoRecover() {
      return (this.p & 255 & 1) == 0;
   }

   public void setAutoRecover(boolean value) {
      if (value) {
         this.p = (byte)(this.p & 254);
      } else {
         this.p = (byte)(this.p | 1);
      }

   }

   public boolean getCrashSave() {
      return (this.p & 255 & 2) != 0;
   }

   public void setCrashSave(boolean value) {
      if (value) {
         this.p = (byte)(this.p | 2);
      } else {
         this.p = (byte)(this.p & 253);
      }

   }

   public boolean getDataExtractLoad() {
      return (this.p & 255 & 4) != 0;
   }

   public void setDataExtractLoad(boolean value) {
      if (value) {
         this.p = (byte)(this.p | 4);
      } else {
         this.p = (byte)(this.p & 251);
      }

   }

   public boolean getRepairLoad() {
      return (this.p & 255 & 8) != 0;
   }

   public void setRepairLoad(boolean value) {
      if (value) {
         this.p = (byte)(this.p | 8);
      } else {
         this.p = (byte)(this.p & 247);
      }

   }

   zpl u() {
      if (this.ae == null) {
         this.ae = new zpl(true);
      }

      return this.ae;
   }

   void a(zpl var1) {
      this.ae = var1;
   }

   zpl v() {
      return this.ae;
   }

   public String getBuildVersion() {
      return this.u().d;
   }

   public void setBuildVersion(String value) {
      this.u().d = value;
   }

   public int getMemorySetting() {
      return this.af;
   }

   public void setMemorySetting(int value) {
      this.af = value;
   }
}
